home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / utility / fdate.zip / HOLIDAYS.BAT < prev    next >
DOS Batch File  |  1997-05-22  |  7KB  |  204 lines

  1.  @echo off
  2.  CLS
  3.  :: HOLIDAYS.BAT
  4.  :: if user specifies a year as parm1, use it
  5.  :: revised 1997 Apr 22 revised to use /Q with /FE /J
  6.  :: revised 1994 Nov 06 to use new /J parm in version 8.8
  7.  :: revised 1996 Jan 26 to correct a mis-spelling
  8.  
  9.  set year=%1
  10.  if not (%year%)==() goto GetYrEnd
  11.  
  12.  :: get name of this batch file, in upper case
  13.  FDATE /fupper /q%0 /v
  14.  
  15.  :: show title between two lines of bars
  16.  fdate /fe /J"L─79" /Q
  17.  fdate /fe /J"C 79" /Q"%fdate%"
  18.  fdate /fe /J"L─79" /Q
  19.  
  20.  :GetYr
  21.  echo.
  22.  echo Please enter the year for which you want holidays calculated,
  23.  FDATE /fget /q"or press ENTER for current year > " /vyear
  24.  if not (%year%)==() goto GetYrEnd
  25.  
  26.  :: get current year
  27.  Fdate /Ff /At /Occyy /vyear
  28.  
  29.  :GetYrEnd
  30.  
  31.  :: pad year to left with zeroes, to make sure it is 4 bytes long
  32.  Fdate /Fe /Q%year%  /JR04 /vyear
  33.  
  34.  echo.
  35.  :: check for validity of year parm (%1)
  36.  Fdate /Fv /A01-01-%year% >nul
  37.  if errorlevel 1 echo Value [%year%] is not a valid year.
  38.  if errorlevel 1 goto Endit
  39.  
  40.  :: --------------------------------------------------------
  41.  :: Determine if year is a leapyear
  42.  :: --------------------------------------------------------
  43.  Fdate /Ff /A01-01-%year% /Oly /vLY
  44.  
  45.  cls
  46.  echo ───────────────────────────────────────────────────────────────────────────────
  47.  if (%LY%)==(0) ECHO                   EVENTS IN %YEAR%
  48.  if (%LY%)==(1) ECHO                   EVENTS IN %YEAR%         Note: %year% is a leap year
  49.  ECHO To print the calendar, press SHIFT+PRINTSCREEN to print each screen.
  50.  echo ───────────────────────────────────────────────────────────────────────────────
  51.  Fdate /Fe /J"L.50" /Vtitle /Q"New Year's Day"
  52.  Fdate /Ff   /A01-01-%year% /P"%title% "
  53.  
  54.  Fdate /Fe /J"L.50" /Vtitle /Q"Epiphany"
  55.  Fdate /Ff  /A01-06-%year%  /P"%title% "
  56.  
  57.  Fdate /Fe /J"L.50" /Vtitle /Q"Martin Luther King, Jr. Day"
  58.  Fdate /Fw /D2 /N3 /A01-01-%year% /P"%title% "
  59.  
  60.  :: note use of CENTER justification in next line
  61.  Fdate /Ff /A02-01-%year% /J"C 79" /P"Note that " /S" begins Black History Month"
  62.  
  63.  Fdate /Fe /J"L.50" /Vtitle        /Q"Valentine's day"
  64.  Fdate /Ff          /A02-14-%year% /P"%title% "
  65.  
  66.  Fdate /Fe /J"L.50" /Vtitle        /Q"Presidents' Day"
  67.  Fdate /Fw /D2 /N3  /A02-01-%year% /P"%title% "
  68.  
  69.  Fdate /Fe /J"L.50" /Vtitle        /Q"St. Patrick's Day"
  70.  Fdate /Ff          /A03-17-%year% /P"%title% "
  71.  
  72.  if (%LY%)==(1) Fdate /Fe /J"L.50" /Vtitle  /Q"Sadie Hawkins Day"
  73.  if (%LY%)==(1) Fdate /Ff /A02-29-%year%    /P"%title% "
  74.  
  75.  :: ========== begin: DATES TIED TO EASTER==============================
  76.  set easter=
  77.  if (%year%)==(1991) set easter=03-31-%year%
  78.  if (%year%)==(1992) set easter=04-19-%year%
  79.  if (%year%)==(1993) set easter=04-11-%year%
  80.  if (%year%)==(1994) set easter=04-03-%year%
  81.  if (%year%)==(1995) set easter=04-16-%year%
  82.  if (%year%)==(1996) set easter=04-07-%year%
  83.  if (%year%)==(1997) set easter=03-30-%year%
  84.  if (%year%)==(1998) set easter=04-12-%year%
  85.  if (%year%)==(1999) set easter=04-04-%year%
  86.  if (%year%)==(2000) set easter=04-23-%year%
  87.  if (%year%)==(2001) set easter=04-15-%year%
  88.  if (%easter%)==() goto unknown
  89.  echo.
  90.  Fdate /Fe /J"L.50" /Vtitle  /Q"Mardi Gras (Shrove Tuesday)"
  91.  Fdate /Fsub /N47 /A%easter% /P"%title% "
  92.  
  93.  Fdate /Fe /J"L.50" /Vtitle  /Q"Ash Wednesday (Lent begins)"
  94.  Fdate /Fsub /N46 /A%easter% /P"%title% "
  95.  
  96.  Fdate /Fe /J"L.50" /Vtitle  /Q"Palm Sunday"
  97.  Fdate /Fsub /N7  /A%easter% /P"%title% "
  98.  
  99.  Fdate /Fe /J"L.50" /Vtitle  /Q"Good Friday"
  100.  Fdate /Fsub /N2  /A%easter% /P"%title% "
  101.  
  102.  Fdate /Fe /J"L.50" /Vtitle  /Q"Easter"
  103.  Fdate /Ff        /A%easter% /P"%title% "
  104.  
  105.  :unknown
  106.  :: ==========    end: DATES TIED TO EASTER==============================
  107.  
  108.  echo ───────────────────────────────────────────────────────────────────────────────
  109.  PAUSE
  110.  CLS
  111.  
  112.  Fdate /Fe /J"L.50" /Vtitle        /Q"Secretary's Day"
  113.  Fdate /Fw /D4 /N4  /A04-01-%year% /P"%title% "
  114.  
  115.  Fdate /Fe /J"L.50" /Vtitle        /Q"Cinco de Mayo (Mexico)"
  116.  Fdate /Ff          /A05-05-%year% /P"%title% "
  117.  
  118.  Fdate /Fe /J"L.50" /Vtitle        /Q"Mother's Day"
  119.  Fdate /Fw /D1 /N2  /A05-01-%year% /P"%title% "
  120.  
  121.  Fdate /Fe /J"L.50" /Vtitle        /Q"Victoria Day (Canada)"
  122.  Fdate /Fw /D2 /N-1 /A05-24-%year% /P"%title% "
  123.  
  124.  Fdate /Fe /J"L.50" /Vtitle        /Q"Memorial Day (observed)"
  125.  Fdate /FW /D2 /N-1 /A05-31-%year% /P"%title% "
  126.  
  127.  Fdate /Fe /J"L.50" /Vtitle                        /Q"Ascension Day"
  128.  if not (%easter%)==() Fdate /Fadd /N39 /A%easter% /P"%title% "
  129.  
  130.  Fdate /Fe /J"L.50" /Vtitle                        /Q"Pentecost"
  131.  if not (%easter%)==() Fdate /Fadd /N49 /A%easter% /P"%title% "
  132.  
  133.  if not (%easter%)==() echo.
  134.  
  135.  Fdate /Fe /J"L.50" /Vtitle  /Q"Flag Day"
  136.  Fdate /Ff /A06-14-%year%    /P"%title% "
  137.  
  138.  :: ----- anniversary of Bloom's Day, June 16, 1904 ------------------
  139.  :: Here's a way to show an anniversary or event that you want to note.
  140.  :: Thanks to L. Schliesser for the algorithm.
  141.  :: ------------------------------------------------------------------
  142.  Fdate /F#dif /A%year% /B1904 /vann
  143.  
  144.  Fdate /Fe /J"L.50" /Vtitle       /Q"Bloom's Day (%ann%th anniversary)"
  145.  Fdate /Ff /A06-16-%year%         /P"%title% "
  146.  SET ann=
  147.  :: ---------------end bloom's day --------------------------------------
  148.  
  149.  Fdate /Fe /J"L.50" /Vtitle      /Q"Father's Day"
  150.  Fdate /Ff /A07-01-%year%        /P"%title% "
  151.  
  152.  Fdate /Fe /J"L.50" /Vtitle      /Q"Independence Day (USA)"
  153.  Fdate /Ff /A07-04-%year%        /P"%title% "
  154.  
  155.  Fdate /Fe /J"L.50" /Vtitle      /Q"Bastille Day (France)"
  156.  Fdate /Ff /A07-14-%year%        /P"%title% "
  157.  
  158.  :: echo ─────────────────────────────────────────────────────────────────────── ────────
  159.  :: PAUSE
  160.  :: CLS
  161.  
  162.  Fdate /Fe /J"L.50" /Vtitle       /Q"Labor Day"
  163.  Fdate /Fw /D2 /N1 /A09-01-%year% /P"%title% "
  164.  
  165.  
  166.  :: ---- begin ------- note a particular day in a particular year
  167.  :: This technique is useful for noting special events:
  168.  :: 21st birthdays, 50th wedding anniversaries, etc.
  169.  
  170.  Fdate /Fe /J"L.50" /Vtitle  /Q"500th anniversary of Columbus's discovery"
  171.  if (%year%)==(1992) Fdate /Ff /A10-12-%year% /P"%title% "
  172.  :: ----   end -------- note a particular day in a particular year
  173.  
  174.  Fdate /Fe /J"L.50" /Vtitle        /Q"Columbus Day (observed)"
  175.  Fdate /Fw /D2 /N2  /A10-01-%year% /P"%title% "
  176.  
  177.  Fdate /Fe /J"L.50" /Vtitle        /Q"Thanksgiving Day (Canada)"
  178.  Fdate /Fw /D2 /N2  /A10-01-%year% /P"%title% "
  179.  
  180.  Fdate /Fe /J"L.50" /Vtitle        /Q"Veteran's Day"
  181.  Fdate /Ff          /A11-11-%year% /P"%title% "
  182.  
  183.  :: Fourth Thursday in November
  184.  Fdate /Fe /J"L.50" /Vtitle        /Q"Thanksgiving Day (USA)"
  185.  Fdate /Fw /D5 /N4  /A11-01-%year% /P"%title% "
  186.  
  187.  
  188.  Fdate /Fe /J"L.50" /Vtitle        /Q"First Sunday in Advent"
  189.  Fdate /Fw /D1 /N-4 /A12-24-%year% /P"%title% "
  190.  
  191.  Fdate /Fe /J"L.50" /Vtitle        /Q"Christmas"
  192.  Fdate /Ff          /A12-25-%year% /P"%title% "
  193.  
  194.  Fdate /Fe /J"L.50" /Vtitle        /Q"New Year's Day"
  195.  Fdate /fadd /N1    /A12-31-%year% /P"%title% "
  196.  
  197.  echo ───────────────────────────────────────────────────────────────────────────────
  198.  :endit
  199.  set year=
  200.  set fdate=
  201.  set easter=
  202.  set title=
  203.  set LY=
  204.